package com.yiwei.hdb.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.yiwei.hdb.R;
import com.yiwei.hdb.adapter.base.ItemAdapter;
import com.yiwei.hdb.model.CertificationDetailModel;

import butterknife.BindView;
import butterknife.ButterKnife;


/**
 * Created by xsooy-pc on 2017/10/23.
 */

public class V3IdentityInfoSuccessAdapter extends ItemAdapter<CertificationDetailModel.DataBean.ItemsBean, V3IdentityInfoSuccessAdapter.DefaultHolder> {


    public V3IdentityInfoSuccessAdapter(Context context) {
        super(context);
    }

    @Override
    public DefaultHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new DefaultHolder(inflate(R.layout.item_identity_info_success, parent));
    }

    @Override
    public void onBindViewHolder(DefaultHolder holder, int position) {
        CertificationDetailModel.DataBean.ItemsBean item = getItem(position);
        holder.txtKey.setText(item.key);
        holder.txtValue.setText(item.value);
    }

    class DefaultHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.txt_key)
        TextView txtKey;
        @BindView(R.id.txt_value)
        TextView txtValue;

        public DefaultHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }
}
